// 检验是否具有相同的字段编码
async function checkField(subData) {
    let componenList = subData.componenList;
    let ifPass = true; //是否通过
    // let errIndex = [];
    for (let i = 0; i < componenList.length; i++) {
        let res = await checkiItem(componenList[i], componenList, i);
        if (res == "break") {
            ifPass = false;
            // errIndex[0] = i;
            break;
        }
    }
    // console.log(errIndex);
    return ifPass;
}

function checkiItem(item, componenList, thisIndex) {
    return new Promise((resolve, reject) => {
        for (let i = 0; i < componenList.length; i++) {
            if (thisIndex != i) {
                if (item.attribute.filedCode == componenList[i].attribute.filedCode) {
                    resolve("break");
                    break;
                }

            }
        }
        resolve("ok");
    });
}

export {
    checkField
};